%==========================================================================
%=  This file is part of the Sound Restoration Project
%=  (c) Copyright Industrial Mathematics Institute
%=                University of South Carolina, Department of Mathematics
%=  ALL RIGHTS RESERVED
%=
%=  Author: Borislav Karaivanov
%==========================================================================

%==========================================================================
% List of the files on which this procedure depends:
%
% a default video player installed on the executing machine
%
%==========================================================================

%==========================================================================
% The function "playMovie" plays a specified video file with an external
% player.
% INPUT: "videoFileName" is a string specifying a video file to be played.
% "playerExecNameAndOptions" is an optional string specifying the name
% (including a full directory path) of a command-line-callable executable
% file for a video player, and any command line options as necessary.
% OUTPUT: None.
%==========================================================================
function playMovie(videoFileName, playerExecNameAndOptions)

if (nargin < 2)
    compOS = computer;
    if strcmp(compOS(1:5), 'PCWIN')
        winopen(videoFileName);
    elseif strcmp(compOS(1:3), 'MAC')
        system(['open "' videoFileName '"']);
    end
else
    postFlags = '';
    system([playerExecNameAndOptions ' "' videoFileName '" ' postFlags]);
end

return;
% end of the function "playMovie"
